package com.library.entity;

import java.io.Serializable;
import java.util.Date;

/**
 * 借阅记录实体类
 */
public class BorrowRecord implements Serializable {
    private static final long serialVersionUID = 1L;
    
    private int id;             // 记录ID
    private int userId;         // 用户ID
    private int bookId;         // 图书ID
    private Date borrowDate;    // 借阅日期
    private Date returnDate;    // 应还日期
    private Date actualReturnDate; // 实际归还日期
    private int status;         // 状态：0-借阅中，1-已归还，2-逾期未还
    
    // 无参构造函数
    public BorrowRecord() {
    }
    
    // 有参构造函数
    public BorrowRecord(int userId, int bookId, Date borrowDate, Date returnDate) {
        this.userId = userId;
        this.bookId = bookId;
        this.borrowDate = borrowDate;
        this.returnDate = returnDate;
        this.status = 0; // 默认状态为借阅中
    }
    
    // Getter和Setter方法
    public int getId() {
        return id;
    }
    
    public void setId(int id) {
        this.id = id;
    }
    
    public int getUserId() {
        return userId;
    }
    
    public void setUserId(int userId) {
        this.userId = userId;
    }
    
    public int getBookId() {
        return bookId;
    }
    
    public void setBookId(int bookId) {
        this.bookId = bookId;
    }
    
    public Date getBorrowDate() {
        return borrowDate;
    }
    
    public void setBorrowDate(Date borrowDate) {
        this.borrowDate = borrowDate;
    }
    
    public Date getReturnDate() {
        return returnDate;
    }
    
    public void setReturnDate(Date returnDate) {
        this.returnDate = returnDate;
    }
    
    public Date getActualReturnDate() {
        return actualReturnDate;
    }
    
    public void setActualReturnDate(Date actualReturnDate) {
        this.actualReturnDate = actualReturnDate;
    }
    
    public int getStatus() {
        return status;
    }
    
    public void setStatus(int status) {
        this.status = status;
    }
    
    @Override
    public String toString() {
        return "BorrowRecord [id=" + id + ", userId=" + userId + ", bookId=" + bookId 
                + ", borrowDate=" + borrowDate + ", returnDate=" + returnDate 
                + ", actualReturnDate=" + actualReturnDate + ", status=" + status + "]";
    }
}
